﻿package view.tips
{
    import com.greensock.*;
    import flash.display.*;

    public class ErrorTips extends Sprite
    {
        private var _tips:Array;

        public function ErrorTips()
        {
            this._tips = new Array();
            return;
        }// end function

        public function addTips(param1:String) : void
        {
            var _loc_3:TextMovie = null;
            var _loc_4:String = null;
            if (param1 == "")
            {
                return;
            }
            var _loc_2:* = new TextMovie(param1, this.removeTips);
            this.addChild(_loc_2);
            _loc_2.y = 4 * 20 + 400;
            if (this._tips.length > 0)
            {
                if (this._tips.length >= 4)
                {
                    _loc_3 = this._tips[0];
                    _loc_3.clear();
                }
                if (this._tips.length > 0)
                {
                    for (_loc_4 in this._tips)
                    {
                        
                        TweenLite.killTweensOf(this._tips[_loc_4], true);
                        TweenLite.to(this._tips[_loc_4], 0.5, {y:this._tips[_loc_4].y - 40});
                    }
                }
            }
            this._tips.push(_loc_2);
            return;
        }// end function

        public function removeTips(param1:TextMovie) : void
        {
            this._tips.splice(this._tips.indexOf(param1), 1);
            TweenLite.killTweensOf(param1, false);
            this.removeChild(param1);
            return;
        }// end function

    }
}
